package cn.com.yang.socket;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * 自定义服务器
 * TODO
 * @author yangyijin
 * @since 2024年1月20日-下午4:48:42
 */
public class ServerSocket9527 {
	public static void main(String[] args) {
		ExecutorService executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()*10);
		try {
			ServerSocket serverSocket = new ServerSocket(9527);
			System.out.println("服务器启动成功了：port 9527");
			Socket socket =  serverSocket.accept();
			executorService.execute(new MyHandler(socket));
//			executorService.shutdown();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
}
